import ajax from '@/utils/request'
import type {spuliatdatamodul,trademarklistmodul,basesaleattrlistmodul} from './model/Spu'

enum Api{
    // 查找数据
    getspulistdataapi ='/admin/product',
    // 修改数据
    postspulistdataapi ='/admin/product/updateSpuInfo',
    // 增加数据
    addspulistdataapi ='/admin/product/saveSpuInfo',
    // 删除数据
    delspulistdataapi ='/admin/product/deleteSpu/{spuId}',
    // 获取所有的品牌列表
    gettrademarklistapi = '/admin/product/baseTrademark/getTrademarkList',
    // 获取销售属性列表
    getbasesaleattrlistapi  = '/admin/product/baseSaleAttrList'
}
// 请求spu数据列表数据
export const reqgetspulistdata = (page:number,limit:number,category3Id:number) => ajax.get<any,spuliatdatamodul>(`${Api.getspulistdataapi}/${page}/${limit}?category3Id=${category3Id}`)

// 获取所有的品牌列表
export const reqgettrademarklist = ()=>ajax.get<any,trademarklistmodul>(Api.gettrademarklistapi)
 // 获取销售属性列表
 export const reqgetbasesaleattrlist = ()=>ajax.get<any,basesaleattrlistmodul>(Api.getbasesaleattrlistapi)


